import React, { useEffect } from 'react'; 
import { notification,contextHolder, message} from 'antd'

const Notification = ({type,desc}) => {

  const [api,contextHolder] = notification.useNotification();
  useEffect(()=>{
    //如果type有值则打开提示框
      if(type){
      api[type]({
        message:'系统通知：',
        desc,
      })
      }
    },[type])
  return (
   <>
   {contextHolder}
   </>

  )
}

export default Notification;

